package com.qsign.sfrz_android.base;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by zhangtao on 16/7/21.
 */
public abstract class BaseFragment extends Fragment {
    Unbinder unbinder;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(getLayoutResId(), container, false);
        unbinder=ButterKnife.bind(this, view);
        initView(view, savedInstanceState);
        return view;
    }

    protected abstract int getLayoutResId();

    protected void initView(View view, Bundle savedInstanceState) {
    }
    @Override
    public void onDestroy() {
        super.onDestroy();
        unbinder.unbind();

    }
}
